//
//  HomePageUserNewsOnlyContentCell.m
//  ShowYork
//
//  Created by hxh on 2020/10/12.
//  Copyright © 2020 hxh. All rights reserved.
//

#import "HomePageUserDynamicContentCell.h"

@interface HomePageUserDynamicContentCell ()
@property (nonatomic,strong)UIImageView *coverView;
@property (nonatomic,strong)UILabel *contentLb;
@property (nonatomic,strong)UIView *titleView;
@property (nonatomic,strong)UILabel *titleLb;
@property (nonatomic,strong)UILabel *timeLb;
@end

@implementation HomePageUserDynamicContentCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self setUI];
    }
    return self;
}

- (void)setUI{
    
    self.coverView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"common_dynamic_bg_tag"]];
    [self.contentView addSubview:self.coverView];
    
    [self.coverView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView).offset(16);
        make.top.equalTo(self.contentView);
        make.width.mas_equalTo(86);
        make.height.mas_equalTo(86);
    }];
    
    self.contentLb = [[UILabel alloc]init];
    self.contentLb.text = @"我们一路相伴的岁月中，每一个人为我们一路相伴的岁月中，每一个人为了";
    self.contentLb.textColor = C51;
    self.contentLb.font = font(12);
    self.contentLb.numberOfLines = 0;
    self.contentLb.textAlignment = NSTextAlignmentCenter;
    [self.coverView addSubview:self.contentLb];
    [self.contentLb mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.coverView).offset(3);
        make.right.equalTo(self.coverView).offset(-3);
        make.top.equalTo(self.coverView).offset(16);
        make.bottom.equalTo(self.coverView).offset(-16);
    }];
    
   
    self.timeLb = [[UILabel alloc]init];
    self.timeLb.text = @"2012-12-12";
    self.timeLb.textColor = C153;
    self.timeLb.font = font(12);
    [self.contentView addSubview:self.timeLb];
    [self.timeLb mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.coverView.mas_right).offset(16);
        make.bottom.equalTo(self.coverView);
    }];
    
}
- (void)setContent:(NSString *)content{
    self.contentLb.text = content;
}
- (void)setModel:(HomePageItemModel *)model{
    _model = model;
    self.contentLb.text = model.contentText;
    self.timeLb.text = model.createDetailTimeStr;
}
@end
